import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',//登录页
    name: 'login',
    component: () => import('../views/login/index.vue')//登录页所在的位置
  },
  {
    path: '/home',//布局页
    name: 'home',
    component: () => import('../views/home/index.vue'),//登录页所在的位置
    children: [ //子路由，让它不跳转到新的页面,而是在右边显示内容
      {
        path: '/index',//首页
        name: 'index',
        component: () => import('../views/home/index/index.vue')
      },
      {
        path: '/imgresource',//相册资源
        name: 'imgresource',
        component: () => import('../views/home/imgresource/index.vue'),
      },
      {
        path: '/jiaocheng',//官方教程
        name: 'jiaocheng',
        component: () => import('../views/home/jiaocheng/index.vue')
      },
      {
        path: '/TopShow',//Top Show
        name: 'TopShow',
        component: () => import('../views/home/TopShow/index.vue')
      }
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
